import React, { Component } from "react";
import { Form, Input } from "antd";
import PropTypes from "prop-types";
//添加form组件
const Item = Form.Item;
export default class AddForm extends Component {
  static propTypes = {
    setForm: PropTypes.func.isRequired,
  };
  constructor(props) {
    super(props);
    this.formRef = React.createRef();
  }
  render() {
    this.props.setForm(this.formRef);
    return (
      <Form onFinish={this.onFinish} ref={this.formRef}>
        <Item label="角色名称" name="name">
          <Input placeholder="输入角色名称" />
        </Item>
      </Form>
    );
  }
}
